/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Dao;

import BackEnd.Exceptions.*;
import com.mysql.jdbc.Connection;
import com.mysql.jdbc.jdbc2.optional.MysqlDataSource;
import java.sql.SQLException;

/**
 *
 * @author Ivan
 */
public abstract class DaoBase <T extends ValueObjectBase>{
    private String urlBaseDao;

    public void crearConexion(String url){

    }
    public Connection getConection(String nombre) throws SQLException
    {
        MysqlDataSource wds= new MysqlDataSource();
        wds.setUser("root");
        wds.setServerName("localhost");
        wds.setPort(3306);
        //wds.setPassword("33437838");
        wds.setDatabaseName("dlc");
        return (Connection)wds.getConnection();
    }

    public abstract T create(T value) throws CreateRegisterException ;
    public abstract void update(T value)throws UpdateRegisterException;
    public abstract T retrive(PkBase pk);
    public abstract void delete(PkBase pk)throws DeleteRegisterException;
    public abstract T[] listarTodos()throws NotExistRegisterException;
    public abstract T[] mostrarConsulta(String consulta)throws NotExistRegisterException;
    public abstract T traer(PkBase pk)throws NotExistRegisterException;

}
